﻿using System.ComponentModel.Design;
using System.Runtime.InteropServices;
using EnvDTE;
using Microsoft.VisualStudio.Shell;

namespace Microsoft.SpecFlowTfsLinker_Extension
{
    [PackageRegistration(UseManagedResourcesOnly = true)]
    [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
    [ProvideMenuResource("Menus.ctmenu", 1)]
    [Guid(GuidList.guidSpecFlowTfsLinker_ExtensionPkgString)]
    [ProvideOptionPage(typeof (VisualStudioParameter),
        "SpecFlow TFS Linker", "SpecFlow TFS Linker Page",
        1000, 1001, false)]
    public partial class SpecFlowTfsLinkerExtensionPackage : Package
    {
        private OleMenuCommandService MenuCommandService
        {
            get { return GetService(typeof (IMenuCommandService)) as OleMenuCommandService; }
        }

        private DTE VisualStudioService
        {
            get { return GetService(typeof (DTE)) as DTE; }
        }

        protected override void Initialize()
        {
            base.Initialize();

            if (null == MenuCommandService) return;

            var menuCommandId = new CommandID(GuidList.guidSpecFlowTfsLinker_ExtensionCmdSet,
                                              (int) PkgCmdIDList.SpecFlowTfsLinker);

            MenuCommandService.AddCommand(new MenuCommand(ExecuteExtension, menuCommandId));
        }
    }
}